package com.cm.dynamic.autoconfigure;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;

import java.io.IOException;
import java.util.Optional;
import java.util.stream.Stream;

/**
 * 动态执行器自动装配属性
 * @author xionglei
 * @version 1.0.0
 * 2021年08月25日 18:56
 */
@ConfigurationProperties(prefix = DynamicProperties.DYNAMIC_PREFIX)
public class DynamicProperties {

    public static final String DYNAMIC_PREFIX = "dynamic";

    // 扫描jar和class类文件的 文件路径兼容Spring classpath路径
    private String[] jarLocations;

    // 扫描mapper xml的类文件路径
    private String[] mapperLocations;

    /**
     * 加载扫描Spring bean 基础包
     * 类似@SpringBootApplication的basePackages
     */
    private String[] basePackages;

    /**
     * 加载mybatis mapper类接口
     */
    private String[] mapperScanPackages;

    private Configuration configuration;

    public String[] getJarLocations() {
        return jarLocations;
    }

    public void setJarLocations(String[] jarLocations) {
        this.jarLocations = jarLocations;
    }

    public Configuration getConfiguration() {
        return configuration;
    }

    public void setConfiguration(Configuration configuration) {
        this.configuration = configuration;
    }

    public String[] getMapperLocations() {
        return this.mapperLocations;
    }

    public void setMapperLocations(String[] mapperLocations) {
        this.mapperLocations = mapperLocations;
    }

    public String[] getBasePackages() {
        return basePackages;
    }

    public void setBasePackages(String[] basePackages) {
        this.basePackages = basePackages;
    }

    public String[] getMapperScanPackages() {
        return mapperScanPackages;
    }

    public void setMapperScanPackages(String[] mapperScanPackages) {
        this.mapperScanPackages = mapperScanPackages;
    }

}
